package com.mhwx.mhlive.ui.adapter;

import android.content.Context;
import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mhwx.mhlive.R;
import com.mhwx.mhlive.util.TablayouUtil;

import java.util.List;



/**
 * 类功能描述
 *
 * @author Guol
 * @version 1.0
 * @copyright 北京明华维新信息技术有限公司
 * @time 2017/5/2
 */
public class RetailersAdapter extends BaseQuickAdapter<String> {
      private Context context;

    public RetailersAdapter(Context context, List<String> data) {
        super(R.layout.item_retailer, data);
        this.context=context;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, String s) {
        baseViewHolder.setText(R.id.tv_name,s);
        LinearLayout.LayoutParams params= (LinearLayout.LayoutParams) baseViewHolder.getView(R.id.fl).getLayoutParams();
        params.height= TablayouUtil.getDisplayMetrics(context).widthPixels;
        baseViewHolder.getView(R.id.fl).setLayoutParams(params);
        baseViewHolder.setImageResource(R.id.img,R.drawable.how_play_pintu_one);
    }
}
